package com.sk.cardeal.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sk.cardeal.R;
import com.sk.cardeal.entity.MaintainBean;

import java.util.List;

/**
 * Created by sk on 2018/3/8.
 */

public class MaintainAdapter extends BaseQuickAdapter<MaintainBean.ResultListBean,BaseViewHolder> {

    public MaintainAdapter(int layoutResId, @Nullable List<MaintainBean.ResultListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MaintainBean.ResultListBean item) {
        helper.setText(R.id.tv_km,String.valueOf(item.getMileage())+"km");
        if(item.getIsOil() == 1){
            helper.setGone(R.id.isOil,true);
        }else {
            helper.setGone(R.id.isOil,false);
        }

        if(item.getIsOilFilter() == 1){
            helper.setGone(R.id.isOilFilter,true);
        }else {
            helper.setGone(R.id.isOilFilter,false);
        }

        if(item.getIsGasolineAdditive() == 1){
            helper.setGone(R.id.isGasolineAdditive,true);
        }else {
            helper.setGone(R.id.isGasolineAdditive,false);
        }

        if(item.getIsAirFiltration() == 1){
            helper.setGone(R.id.isAirFiltration,true);
        }else {
            helper.setGone(R.id.isAirFiltration,false);
        }

        if(item.getIsAirConditioning() == 1){
            helper.setGone(R.id.isAirConditioning,true);
        }else {
            helper.setGone(R.id.isAirConditioning,false);
        }

        if(item.getIsBrakeFluid() == 1){
            helper.setGone(R.id.isBrakeFluid,true);
        }else {
            helper.setGone(R.id.isBrakeFluid,false);
        }

        if(item.getIsTransmissionOil() == 1){
            helper.setGone(R.id.isTransmissionOil,true);
        }else {
            helper.setGone(R.id.isTransmissionOil,false);
        }

        if(item.getIsFuelfilter() == 1){
            helper.setGone(R.id.isFuelfilter,true);
        }else {
            helper.setGone(R.id.isFuelfilter,false);
        }

        if(item.getIsSparkPlug() == 1){
            helper.setGone(R.id.isSparkPlug,true);
        }else {
            helper.setGone(R.id.isSparkPlug,false);
        }

        if(item.getIsAntifreeze() == 1){
            helper.setGone(R.id.isAntifreeze,true);
        }else {
            helper.setGone(R.id.isAntifreeze,false);
        }
    }
}
